namespace ETestIT.Tests.DataAccess
{
    using System.Data;
    using System.Data.SqlClient;
    using ETestIT.DataAccess.Repository;
    using NUnit.Framework;

    [TestFixture]
    public class FluentAdoNetRepository
    {
        [Test]
        public void IsConnectionFactoryReadyToDoSqlConnections()
        {
            SqlConnection connection = ConnectionFactory.GetConnection();
            Assert.That(connection!= null);
            connection.Close();
        }

        [Test]
        public void IsAttemptToOpenAndCloseAConnectionSuccessiful()
        {
            using (var conn = ConnectionFactory.GetConnection())
            {
                Assert.That(conn.State == ConnectionState.Open);
                conn.Close();
            }
        }
    }
}